<!DOCTYPE html>
<html lang="zh">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/header :: header(~{::title},~{::link},~{})">
    <title>周计划详情</title>
    <link rel="icon" th:href="@{/assets/img/lcxm.ico}" type="image/ico">
</head>
<body class="body">
<!--导航-->
<div th:replace="common/nav :: nav(true)"></div>

<div class="container">

    <div class="row">
        <div style="margin-top: 20px;"></div>
        <div class="row">

            <form class="form-horizontal validate" role="form" method="post" th:action="@{/project/save}"
                  onsubmit="return checkForm(this);">

                <!-- 操作信息提示的地方 -->
                <div th:if="${remind}" class="alert alert-${ remind.level  }"
                     th:classappend="'alert-' + ${remind.level}">
                    <button data-dismiss="alert" class="close" type="button">
                        <i class="glyphicon glyphicon-remove"></i>
                    </button>
                    <span th:remove="tag" th:utext="${ remind.message }"></span>
                </div>

                <input type="hidden" id="planId" th:value="${entity?.id}"/>
                <input type="hidden" id="userId" th:value="${entity?.userId}"/>
                <div class="col-sm-12 col-sm-offset-0">
                    <table class="table table-striped table-condensed table-bordered stable">
                        <caption>周计划基本信息</caption>
                        <tbody>
                        <tr class="success">
                            <th>小组</th>
                            <th>用户</th>
                            <th>周次</th>
                            <th>时间</th>
                            <th>状态</th>
                            <th>实际使用工时</th>

                        </tr>
                        <tr class="text-center text-danger">
                            <td th:text="${entity?.groupName}">groupName</td>
                            <td th:text="${entity?.userName}">userName</td>
                            <td th:text="${entity?.weekNumber}">weekNumber</td>
                            <td>
                                 <span class="text-success"
                                       th:text="${#dates.format(entity?.weekStart, 'MM-dd')}"></span>—
                                <span class="text-success"
                                      th:text="${#dates.format(entity?.weekEnd, 'MM-dd')}"></span>
                            </td>
                            <td th:text="${entity?.submissionStatus?.text}">status</td>
                            <td th:text="${entity?.actualEffort}">actualEffort</td>
                        </tr>

                    </table>

                </div>
                <div class="col-sm-12 col-sm-offset-0">
                    <div class="action-bar">
                        <a class="btn btn-sm btn-success" id="addPlanDetail" onclick="addRowDetail();" title="新增计划">
                            <i class="glyphicon glyphicon-plus"></i> 新增计划
                        </a>
                    </div>

                    <table class="table table-striped  table-hover table-bordered stable">
                        <caption>周计划列表
                        </caption>
                        <colgroup>
                            <col style="width: 6%;">
                            <col style="width: 20%;">
                            <col style="width: 8%;">
                            <col style="width: 8%;">
                            <col style="width: 8%;">
                            <col style="width: 10%;">
                            <col style="width: 10%;">
                            <col style="width: 15%;">
                            <col style="width: 10%;">
                        </colgroup>
                        <thead>
                        <tr class="text-center">
                            <th>序号</th>
                            <th>计划说明</th>
                            <th>需要支持</th>
                            <th>预计工时</th>
                            <th>实际工时</th>
                            <th>预计完成</th>
                            <th>实际完成</th>
                            <th>进度</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody align="center" id="tbody">
                        <tr th:each="cur : ${details != null ? details : {}}">
                            <td th:text="${cur.sequenceNumber}">
                            </td>
                            <td>
                                <p style="white-space: pre-wrap" th:text="${cur.description}"></p>
                            </td>
                            <td th:text="${cur.needsSupport?'是':'否'}">
                            </td>
                            <td th:text="${cur.estimatedEffort}">
                            </td>
                            <td th:text="${cur.actualEffort}">
                            </td>
                            <td th:text="${#dates.format(cur.plannedCompletionDate, 'yyyy-MM-dd')}">
                            </td>
                            <td th:text="${#dates.format(cur.actualCompletionDate, 'yyyy-MM-dd')}">
                            </td>
                            <td>
                                <div class="progress">
                                    <div class="progress-bar progress-bar-success" role="progressbar"
                                         aria-valuenow="${cur.progress}"
                                         aria-valuemin="0"
                                         aria-valuemax="100"
                                         th:style="'width:' + ${cur.progress} + '%;'">
                                        <span th:text="${cur.progress} + '%'">40%</span> <!-- 动态显示百分比 -->
                                    </div>
                                </div>
                            </td>
                            <td th:text="${cur.status?.text}">
                            </td>

                        </tr>
                        <!-- </c:forEach> -->
                        </tbody>
                    </table>
                </div>


                <div class="form-group clearfix">
                    <div class="col-sm-offset-4 col-sm-8">
                        <a type="button" class="btn btn-sm  btn-info" id="backBtn" th:href="@{/plan/}">
                            <i class="glyphicon glyphicon-repeat"></i> 返回
                        </a>
                    </div>
                </div>


            </form>

        </div>


    </div>
</div>

<!-- 引入通用js-->
<div th:replace="common/footer :: footer"></div>
<script th:src="@{/js/plan/plan.js}"></script>
<script>
    function checkForm(form) {

        return true;
    };


</script>

</body>
</html>